import { FormatMessageProps } from "@/locales"

export const columnsFinaceInfoWinOrLose = (formatMessage: FormatMessageProps, renderColor: any) => [
	{
		dataIndex: "gameName",
		title: formatMessage({ id: "member.finace_info.venue" }),
		render: (value: any, record: any) => (
			<p className="text-game" style={{ color: "#409EFF" }}>
				{record.gameName}
			</p>
		),
		width: 150,
		align: "center",
		key: "gameName"
	},
	{
		dataIndex: "netAmount",
		title: formatMessage({ id: "member.finace_info.members_win_or_lose" }),
		render: (value: any, record: any) => {
			return <p>{renderColor(record.netAmount)}</p>
		},
		width: 150,
		align: "center",
		key: "netAmount"
	},
	{
		dataIndex: "betAmount",
		title: formatMessage({ id: "member.finace_info.bet_amount" }),
		render: (value: any, record: any) => {
			const isNegative = record.betAmount < 0 ? true : false
			return (
				<p className={isNegative ? "text-red" : ""}>
					{isNegative && "-"}${(record.betAmount * (isNegative ? -1 : 1)).toLocaleString("en-US")}
				</p>
			)
		},
		width: 150,
		align: "center",
		key: "bet_amount"
	},
	{
		dataIndex: "validBetAmount",
		title: formatMessage({ id: "member.finace_info.valid_bet" }),
		render: (value: any, record: any) => {
			const isNegative = record.validBetAmount < 0 ? true : false
			return (
				<p className={isNegative ? "text-red" : ""}>
					{isNegative && "-"}${(record.validBetAmount * (isNegative ? -1 : 1)).toLocaleString("en-US")}
				</p>
			)
		},
		width: 150,
		align: "center",
		key: "validBetAmount"
	}
]
export const columnsFinaceInfoBet = (formatMessage: FormatMessageProps, renderColor: any) => [
	{
		dataIndex: "gameName",
		title: formatMessage({ id: "member.finace_info.venue" }),
		render: (value: any, record: any) => {
			return <p style={{ color: "#409EFF" }}>{record.gameName}</p>
		},
		width: 150,
		align: "center",
		key: "gameName"
	},
	{
		dataIndex: "betAmount",
		title: formatMessage({ id: "member.finace_info.bet_amount" }),
		render: (value: any, record: any) => {
			const isNegative = record.betAmount < 0 ? true : false
			return (
				<p className={isNegative ? "text-red" : ""}>
					{isNegative && "-"}${(record.betAmount * (isNegative ? -1 : 1)).toLocaleString("en-US")}
				</p>
			)
		},
		width: 150,
		align: "center",
		key: "betAmount"
	},
	{
		dataIndex: "validBetAmount",
		title: formatMessage({ id: "member.finace_info.valid_bet" }),
		render: (value: any, record: any) => {
			const isNegative = record.validBetAmount < 0 ? true : false
			return (
				<p className={isNegative ? "text-red" : ""}>
					{isNegative && "-"}${(record.validBetAmount * (isNegative ? -1 : 1)).toLocaleString("en-US")}
				</p>
			)
		},
		width: 150,
		align: "center",
		key: "validBetAmount"
	},
	{
		dataIndex: "netAmount",
		title: formatMessage({ id: "member.finace_info.members_win_or_lose" }),
		render: (value: any, record: any) => {
			const isNegative = record.netAmount < 0 ? true : false
			return (
				<p className={isNegative ? "text-red" : ""}>
					{renderColor(`${isNegative && "-"}$${(record.netAmount * (isNegative ? -1 : 1)).toLocaleString("en-US")}`)}
				</p>
			)
		},
		width: 150,
		align: "center",
		key: "netAmount"
	}
]
